AZ-204 Quiz

← Back to Topics

Key Vault (1 / 13):

Your organization is developing a secure application that involves handling confidential data. You have been tasked with the following requirements:

  1. Establish a connection to a remote vault service to manage sensitive keys and secrets.
  2. Retrieve a designated secret from the vault.
  3. Obtain a specific cryptographic key from the vault.
  4. Use the obtained key to perform the following cryptographic operations:
    • Add the secret value to a given plaintext message, then encrypt it using an asymmetric encryption algorithm.
    • Decrypt the resulting ciphertext using the same algorithm.

Provide the code to fulfill these requirements, adhering to industry standards for secure communication and cryptographic practices.

var vaultUrl = "https://<your-key-vault-name>.vault.azure.net/";
var credential = new DefaultAzureCredential();
var secretKeyName = "<YourSecretName>";
var plaintext = "<To be encrypted>";
var encryptionAlgorithm = EncryptionAlgorithm.RsaOaep;

// Code here


Exam revision: April 11, 2025